package com.niguang.labour.admin.service.impl;

import com.niguang.labour.admin.entity.AdminLaborUser;
import com.niguang.labour.admin.entity.WorkLaborCompany;
import com.niguang.labour.admin.mapper.WorkLaborCompanyMapper;
import com.niguang.labour.admin.service.WorkLaborCompanyService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 'work.v_personSite' is not BASE TABLE 服务实现类
 * </p>
 *
 * @author 
 * @since 2018-06-10
 */
@Service
public class WorkLaborCompanyServiceImpl extends ServiceImpl<WorkLaborCompanyMapper, WorkLaborCompany> implements WorkLaborCompanyService {

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void register(WorkLaborCompany workLaborCompany, AdminLaborUser user) {
        workLaborCompany.insert();
        user.setLaborCompanyId(workLaborCompany.getId());
        user.updateById();
    }
}
